/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.transfer.validation;

import com.transfer.annotation.LessThan;
import javax.faces.event.PhaseListener;
import org.apache.myfaces.extensions.validator.core.ExtValContext;
import org.apache.myfaces.extensions.validator.core.initializer.configuration.StaticConfigurationNames;
import org.apache.myfaces.extensions.validator.core.initializer.configuration.StaticInMemoryConfiguration;
import org.apache.myfaces.extensions.validator.core.startup.AbstractStartupListener;

/**
 *
 * @author bkummel
 */
public class LessThanStartupListener extends AbstractStartupListener {

    @Override
    protected void init() {
        StaticInMemoryConfiguration config = new StaticInMemoryConfiguration();

        config.addMapping(
                LessThan.class.getName(),
                LessThanStrategy.class.getName());

        ExtValContext.getContext().addStaticConfiguration(
                StaticConfigurationNames.META_DATA_TO_VALIDATION_STRATEGY_CONFIG,
                config);
    }
}
